|
|
|
|
|
|
|
Runtime Properties of the DateTimePicker Control |
|
|
|
|
|
|
|
|
Because the DateTimePicker control is used to select dates at runtime, youll be manipulating many properties at runtime to retrieve date data. Using these runtime properties, you can retrieve any portion of the date thats contained in the DateTimePicker control. Table 31.2 gives you a list of the properties that retrieve the different parts of the date selected. |
|
|
|
|
| Table 31.2 Runtime Properties of the DateTimePicker Control. | | Runtime Property | Description | | Day | Returns the day as a two-digit number. | | Month | Returns the month as a two-digit number. Predefined constants are also available for each monthmvwJanuary, mvwFebruary, and so on. | | Year | Returns the year as a four-digit number. | | Hour | Returns the hour as a two-digit number. | | Minute | Returns the minute as a two-digit number. | | Second | Returns the seconds as a two-digit number. | | DayOfWeek | Returns the day of the week as a one-digit number. Predefined constants for each day of the week are built into Visual Basic. For example, mvwSunday, mvwMonday, mvwTuesday, and so on. |
|
|
|
|
|
|
The Format property is used to display and input dates in a set of predefined formats. Besides inputting date formats, youre also allowed to input times. You can even display both a date and a time by using a custom format. |
|
|
|
|
|
|
|
|
Table 31.3 gives you a list of what the predefined values are for the Format property. You can also see an example of what each predefined format will make the control look like at runtime. |
|
|
|
|
|